home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Media 20
/
PC MEDIA CD20.iso
/
share
/
prog
/
asm105
/
power2.asm
< prev
next >
Wrap
Assembly Source File
|
1995-08-31
|
1KB
|
62 lines
; +-------------------------------------------------------+ ;
; | Sample power program for use with the Magic Assembler | ;
; +-------------------------------------------------------+ ;
false equ 00
true equ 01
nodigit equ 0080
nopower equ 00c0
xor al,al
mov di,offset(a)
mov cx,nodigit
@1 stosb
loop @1
mov byte[offset(a)],01
mov cx,nopower
@2 push cx
mov si,offset(a)
mov di,offset(a)
mov cx,nodigit
@4 push cx
lodsb
add al,al
stosb
pop cx
loop @4
mov si,offset(a)
mov di,offset(a)
mov cx,nodigit
@3 push cx
lodsb
cmp al,0a
jb @9
sub al,0a
inc byte [si]
@9 stosb
pop cx
loop @3
pop cx
loop @2
std
mov si,offset(a)+nodigit
dec si
mov cx,nodigit
@5 lodsb
add al,30
cmp display,false
je @6
@8 mov ah,0e
mov bx,0007
int 10
jmps @7
@6 cmp al,30
je @7
mov display,true
jmps @8
@7 loop @5
int 20
display db false
-
a ds nodigit